package com.example.runner;

import com.example.instance.BootNettyClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @ClassName: BootNettyClientRunner
 * @Author : 13736
 * @Date :2023/7/8  15:42
 * @Description: TODO
 * @Version :1.0
 */
@Slf4j
@Component
public class BootNettyClientRunner implements ApplicationRunner {
    @Resource
    private BootNettyClient bootNettyClient;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        try {
            bootNettyClient.connect();
        } catch (Exception e) {
            log.error("connect server error.",e);
        }
    }
}
